<extend name="Include:Layout"/>
<block name="title">首页</block>
<block name="style">
<style>
.swiper-container {
    width: 100%;
} 

.swiper-container img {
    display: block;
    width: 100%;
}

</style>
</block>

<block name="main">
	<div class="weui_tab">
		<div class="weui_tab_bd container weui-pull-to-refresh" id="container">
			<div class="weui-pull-to-refresh-layer">
			    <div class="pull-to-refresh-arrow"></div> <!-- 上下拉动的时候显示的箭头 -->
			    <div class="pull-to-refresh-preloader"></div> <!-- 正在刷新的菊花 -->
			    <div class="down">下拉刷新</div><!-- 下拉过程显示的文案 -->
			    <div class="up">释放刷新</div><!-- 下拉超过50px显示的文案 -->
			    <div class="refresh">正在刷新...</div><!-- 正在刷新时显示的文案 -->
			</div>
			<!-- 校区介绍 -->
			<div class="swiper-container">
		      	<div class="swiper-wrapper">
		        	<!-- Slides -->
		        	<div class="swiper-slide"><a href="{:U('article')}"><img src="http://lihongxun945.github.io/jquery-weui/dist/demos/images/swiper-1.jpg" /></a></div>
		        	<div class="swiper-slide"><a href="{:U('article')}"><img src="http://lihongxun945.github.io/jquery-weui/dist/demos/images/swiper-2.jpg" /></a></div>
		        	<div class="swiper-slide"><a href="{:U('article')}"><img src="http://lihongxun945.github.io/jquery-weui/dist/demos/images/swiper-3.jpg" /></a></div>
		      	</div>
		      	<!-- If we need pagination -->
		      	<div class="swiper-pagination"></div>
		    </div>
			<div class="weui_cells weui_cells_access">
		        <a class="weui_cell" href="{:U('yuyue')}">
		            <div class="weui_cell_bd weui_cell_primary">
		                <div class="weui_media_hd">	
		            		<h2 style="width:58px;;font-size:18px;line-height:28px;border-right:1px solid #E8E8E8">我 想<br>体 验</h2>
		            	</div>
		            </div>
		            <div class="weui_cell_ft">
		            	预约免费试听
		            </div>
		        </a>
		        
		    </div>
			
			
			<div class="weui_panel weui_panel_access">
		        <div class="weui_panel_hd">教学视频</div>
		        <div class="weui_panel_bd" id="vediolist">
		            
		        </div>
		       	<a class="weui_panel_ft" href="{:U('vedios')}">查看更多</a>
		    </div>
		    
		    
	    </div>
		
		<php>$curbar = 1;</php>
    	<include file="Include:navbar" />
   </div>
<script type="text/html" id="article_list_tuwen">
<a href="/web/index/article/id/{{id}}" class="weui_media_box weui_media_appmsg">
    <div class="weui_media_hd">
        <img class="weui_media_appmsg_thumb" src="{{pic}}" alt="">
    </div>
    <div class="weui_media_bd">
        <h4 class="weui_media_title">{{title}}</h4>
        <p class="weui_media_desc">{{summary}}</p>
    </div>
</a>
</script>
</block>

<block name="script">
<script type='text/javascript' src='/Public/Assets/jqweui/src/js/swiper.js'></script>
<script>
$("#container").pullToRefresh();
$("#container").on("pull-to-refresh", function() {
	alert('这边执行刷新操作');
	$("#container").pullToRefreshDone();
});
$(function () {
	//幻灯片
	$(".swiper-container").swiper({
        loop: true,
        autoplay: 3000
    });
	//加载视频列表
	loadvedio();
	//查看视频
	/*
	$('.showvedio').click(function(){
		var $this = $(this);
		$.showLoading("正在加载...");
		$.get('/home/home/get_vedio_test/id/'+$this.attr('data-id'),function(ret){
			$.hideLoading();
			if(ret.status){
				$('#article_detail .weui-popup-modal .content').html('');
				var html = template("tpl_article_vedio",ret.data);
				$('#article_detail .weui-popup-modal .content').html(html);
				$("#article_detail").popup();
			}else{
				$.alert(ret.info);
			}
		});
	});
	*/
   
});
//param里面加入一些参数
function loadvedio(param){
	$.get('/Web/index/get_vedio_test',function(ret){
		if(ret.status){
			var data = ret.data;
			var html = '';
			for(var i = 0 ;i<data.length;i++){
				html += template('article_list_tuwen',data[i]);
			}
			$('#vediolist').html(html);
		}
	});
}
</script>
</block>